﻿using System.IO;
using System.Net.Sockets;

namespace FemtoHttpd
{
    public class FemtoHttpContext
    {
        private FemtoHttpRequest _request;
        public TcpClient TcpClient { private set; get; }
        public FemtoHttpRequest Request => _request ?? (_request = FemtoHttpRequest.Get(TcpClient.GetStream()));
        public Stream Output => TcpClient?.GetStream();

        public FemtoHttpContext(TcpClient client)
        {
            TcpClient = client;
        }
    }
}